<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>仪器共享</title>
<meta name="keywords" content="科研仪器，生命科学仪器，环境检测仪器，实验常用设备，分析仪器">
<meta name="description"
	content="中国领先的科研仪器共享平台，让您快速找到各种类型的科学研究仪器。提升闲置仪器利用率，产生更大科研价值。涵盖：生命科学仪器、环境检测仪器、实验常用设备、分析仪器、仪表、物性测试、测量/计量仪器、在线及过程控制仪器。

">
<!-- <link rel="stylesheet" href="new_css/header_footer.css?t=1"> -->
<link rel="stylesheet" href="new_css/instrumentList.css">
<script src="new_js/jquery-1.11.3.js"></script>
<script>
	$(function() {
		$('#front_header .header_wrap .right').hover(function() {
			$('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon2.png');
			$('#front_header .header_wrap .right .out').show();
		}, function() {
			$('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon1.png');
			$('#front_header .header_wrap .right .out').hide();
		});
		$('#sorts').on('mouseover', 'li', function() {
			$(this).find('span img').attr('src', 'images/icon4.png');
		});
		$('#sorts').on('mouseout', 'li', function() {
			$(this).find('span img').attr('src', 'images/icon5.png');
		});

		$('.mainList .content .left li').click(function() {
			$(this).addClass('selected').siblings().removeClass('selected');
		});
		$('.mainList .content .search .item .right ul li').click(function() {
			$(this).addClass('selected').siblings().removeClass('selected');
		});
	});
</script>

</head>

<body style="background:#fff;">

	<%@include file="/header.jsp"%>
	<div class="mainList">
		<div class="bNav">
			您的位置：首页><span>服务列表</span>
		</div>
		<div class="content">
			<div class="search">
				<div class='item'>
					<div class="left">地区：</div>
					<div class="right">
						<ul id="address">
							<li class="selected">不限</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
							<li>分析仪器</li>
							<li>不胡不不分析仪器</li>
						</ul>
					</div>
				</div>
			</div>



			<div class="list">
				<ul id="service_list">
					<!-- <li>
						<div class="pic">
							<img src="images/productDetailPic.png" />
						</div>
						<div class="info">
							<div class="title">全功能紫外-可见-近红外荧光光谱仪</div>
							<div class="row2">
								<div class="font">
									型号：<span>123456</span>
								</div>
								<div class="font">
									提供单位：<span>大型仪器中心</span>
								</div>
								<div class="font">
									地区：<span>北京</span>
								</div>
							</div>
							<div class="row3">
								功能：<span>气相色谱</span>
							</div>
						</div>
						<div class="price">
							<div class="wrap">
								<p>¥300元/小时</p>
								<p>
									<span>已预约321次</span>
								</p>
							</div>
						</div>


						<div class="active">
							<div>
								<a href="productDetail5.html">立即预约</a>
							</div>
							<div style="display:none">
								<a href="productDetail5.html">立即预约</a>
							</div>
							<div>
								<a href="#this">电话咨询</a>
							</div>
						</div>
					</li>
					<li>
						<div class="pic">
							<img src="images/productDetailPic.png" />
						</div>
						<div class="info">
							<div class="title">全功能紫外-可见-近红外荧光光谱仪</div>
							<div class="row2">
								<div class="font">
									型号：<span>123456</span>
								</div>
								<div class="font">
									提供单位：<span>大型仪器中心</span>
								</div>
								<div class="font">
									地区：<span>北京</span>
								</div>
							</div>
							<div class="row3">
								功能：<span>气相色谱</span>
							</div>
						</div>


						<div class="price">
							<div class="wrap">
								<p>¥300元/小时</p>
								<p>
									<span>已预约321次</span>
								</p>
							</div>
						</div>
						<div class="active">
							<div>
								<a href="productDetail5.html">立即预约</a>
							</div>
							<div style="display:none">
								<a href="productDetail5.html">立即预约</a>
							</div>
							<div>
								<a href="#this">电话咨询</a>
							</div>
						</div>
					</li>
					<li>
						<div class="pic">
							<img src="images/productDetailPic.png" />
						</div>
						<div class="info">
							<div class="title">全功能紫外-可见-近红外荧光光谱仪</div>
							<div class="row2">
								<div class="font">
									型号：<span>123456</span>
								</div>
								<div class="font">
									提供单位：<span>大型仪器中心</span>
								</div>
								<div class="font">
									地区：<span>北京</span>
								</div>
							</div>
							<div class="row3">
								功能：<span>气相色谱</span>
							</div>
						</div>
						<div class="price">
							<div class="wrap">
								<p>¥300元/小时</p>
								<p>
									<span>已预约321次</span>
								</p>
							</div>
						</div>


						<div class="active">
							<div>
								<a href="productDetail5.html">立即预约</a>
							</div>
							<div style="display:none">
								<a href="productDetail5.html">立即预约</a>
							</div>
							<div>
								<a href="#this" id="Button1"  onclick="ShowDiv('MyDiv','fade')">电话咨询</a>
							</div>
						</div>

					</li> -->
				</ul>
			</div>
		</div>
	</div>

	<div class="zzsc myPage">
	<!--currentpage="1" numbercount="100"-->
	<ul class="page" maxshowpageitem="5" pagelistcount="10"  id="page"></ul>

	</div>
	<%@include file="/footer.jsp"%>
	<script>
		$(document).ready(function(){
			//var offset = 0;
			getCity();
			//list(offset);
			MyObjectLoad();
			Date.prototype.Format = 
				function(fmt){
				var o = {
					"M+": this.getMonth() + 1, //月份 
	       			"d+": this.getDate(), //日 
	        		"h+": this.getHours(), //小时 
	        		"m+": this.getMinutes(), //分 
	        		"s+": this.getSeconds(), //秒 
	        		"q+": Math.floor((this.getMonth() + 3) / 3), //季度 
	        		"S": this.getMilliseconds() //毫秒 
				};
				if(/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
				for(var k in o)
				if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	    		return fmt;
			}
		})
		
		
		MyObject = {
			url : Server+"/service_list/list",
			//url : "http://localhost/service_list/list",
			ishavesend : 0,
			boolean : false,
			type : "POST",
			dataType : "JSON",
			number : 1,
			AllCount : 0,
			nowp : 0,
			Callback : function(nowPage){
				MyObject.nowp = nowPage;
				list(MyObject.nowp -1);
			}
		};
		
		function MyObjectLoad(){
			var name = $('#search_box').val();
			var address = $('#address .selected').attr("data-appid");
			$("#page").initPage((function(){
				$.ajax({
					"url" : MyObject.url,
					"type" : MyObject.type,
					"dataType" : MyObject.dataType,
					"async" : MyObject.boolean,
					"data" : {
						"offset" : MyObject.number,
						"limit" : MyObject.number,
						"name" : name,
						"address" : address,
					},
					success : function(data){
						MyObject.AllCount = data.total;
					}
				});
				return MyObject.AllCount;
			})(), MyObject.number, MyObject.Callback);
		}
		MyObjectLoad();
		
		function getCity(){
			$.ajax({
				//url:"http://localhost/user/sum/city",
				url:Server + "/user/sum/city",
				data:{},
				type:"POST",
				dataType:"json",
				success : function(data){
					var html = "";
					var pattren = '<li data-appid="#1">#0</li>';
					var top = '<li data-appid="" class="selected">不限</li>';
					for(var i = 0;i < data.length;i++){
						var item = "";
						var param = data[i];
						item += pattren
							.replace("#0",param.cityName)
							.replace("#1",param.cityId),
						html += item;
					}
					html = top + html;
					$('#address').html(html);
					$('.mainList .content .left li').click(function(){
						$(this).addClass('selected').siblings().removeClass('selected');
						MyObjectLoad();
					});
					$('.mainList .content .search .item .right ul li').click(function(){
						$(this).addClass('selected').siblings().removeClass('selected');
						MyObjectLoad();
					});
				}
			})
		}
		
		function list(offset) {
			var name = $('#search_box').val();
			var address = $('#address .selected').attr("data-appid");
			$.ajax({
				url : Server+"/service_list/list",
				//url : "http://localhost/service_list/list",
				data:{
					limit:10,
					offset:offset,
					name:name,
					address:address,
				},
				type : "POST",
				dataType : "json",
				success : function(data) {
				console.log(JSON.stringify(data));
					var param = data.rows;
					var html = "";
					var pattern = '<li>\
							<div class="pic"><img src=#0 /></div>\
							<div class="info">\
								<div class="title">#1</div>\
								<div class="row2">\
									<div class="font">结果时间：<span>#2</span></div>\
									<div class="font">服务机构：<span>#3</span></div>\
									<div class="font">地区：<span>#4</span></div>\
								</div>\
								<div class="row3">功能：<span>#5</span></div>\
							</div>\
							<div class="price">\
								<div class="wrap">\
									<p>¥#8#11</p>\
									<p><span>已预约#7次</span></p>\
								</div>\
							</div>\
							<div class="active12">\
								<div><a href="serviceDetail14_2?serviceId=#6">立即预约</a></div>\
								<div><a onclick="ShowDiv(this)" data-appid="#9" data-appid1="#10">电话咨询</a></div>\
							</div>\
						</li>';
					for (var i = 0; i < param.length; i++) {
						var item = "";
						var order = param[i];
						var unit = (order.unit == null)?'元/天':order.unit;
						var getTime = new Date();
						getTime = getTime.setDate(getTime.getDate() + order.getTime);
						item += pattern
							.replace("#0", order.ssimagelist[0].imagePath)
							.replace("#1", order.serviceName)
							.replace("#2", timestampToTime(getTime))
							.replace("#3", order.serviceAgency)
							.replace("#4", order.address)
							.replace("#5", order.serviceContent)
							.replace("#6", order.serviceId)
							.replace("#7", order.scount)
							.replace("#8", order.serviceFee)
							.replace("#9", order.contacts)
							.replace("#10", order.mobile)
							.replace("#11", unit);
						html += item;
					}
					$("#service_list").html(html);
				},
			});
		}
		$('#seek').click(function(){
			MyObjectLoad();
		})
	</script>

	<script src="js/new_js/common.js"></script>

	<style>
	.mainList .content .list li {
		margin-top: 20px;
		/* width: 96%; */
		width: 1158px;
		border: 1px solid #d3d3d3;
		padding: 20px;
		display: table;
	}

	.mainList .content .list li .active12>div {
	text-align: center;
	margin-bottom: 10px;
	}

	.mainList .content .list li .active12>div:nth-of-type(2) a {
	background: #00AEFF;
	}

	.mainList .content .list li .active12>div a {
	display: block;
	width: 178px;
	height: 42px;
	text-align: center;
	line-height: 42px;
	color: #fff;
	font-size: 22px;
	background: #ff8a00;
	border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	}
	.mainList .content .list li .active12>div a {
	display: block;
	width: 178px;
	height: 42px;
	text-align: center;
	line-height: 42px;
	color: #fff;
	font-size: 22px;
	background: #ff8a00;
	border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	}

	.header-search-right .search-text input {
		width: 606px;
		height: 49px !important;
		border: 1px solid #FF8A00;
		border-radius: 4px 0px 0px 4px;
		padding-left: 35px;
		font-size: 12px;
		<%--background: url("images/search.png") no-repeat 10px 17px;--%>
	}


	.zzsc {
	width: 845px;
	float: right;
	margin: 40px 0px;
	}
	</style>
	<!--弹出层时背景层DIV-->


	<div id="fade" class="black_overlay"></div>
	<div id="MyDiv" class="white_content">
		<div class="title-tan">
			<div class="xix">
				<p>联系方式</p>
			</div>
			<div class="close" style="" onclick="CloseDiv('MyDiv','fade')">X</div>
		</div>
		<div class="content-tan">
			<ul>
				<li>
					<label >联系姓名：</label>
					<input disabled="disabled" type="text" id="person">
				</li>
				<li>
					<label>联系电话：</label>
					<input disabled="disabled" type="tel" id="telephone">
				</li>
			</ul>
		</div>
		<div class="btn-tan">
			<a class="close" style="" onclick="CloseDiv('MyDiv','fade')">取消</a>
		</div>
	</div>

	<style>
	.black_overlay {
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 100%;
	height: 100%;
	background-color: #666;
	z-index: 1001;
	-moz-opacity: 0.8;
	opacity: .70;
	filter: alpha(opacity=70);
	}

	.white_content {
	display: none;
	position: fixed;
	top: 35%;
	left: 30%;
	height: 266px;
	background-color: white;
	z-index: 1002;
	overflow: auto;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	}
	.title-tan {
	width: 500px;
	height: 46px;
	line-height: 7px;
	border-bottom: 1px solid #CCCCCC;
	}

	.xix {
	text-align: right;
	width: 100px;
	height: 46px;
	float: left;
	line-height: 50px;
	font-size: 20px;
	display: flex;
	justify-content: center;
	}

	.title-tan p {
	float: left;
	width: 300px;
	display: inline-block;
	}

	.close {
	float: right;
	width: 50px;
	height: 45px;
	color: #ccc;
	line-height: 50px;
	cursor: pointer
	}

	.content-tan {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 19px;
	line-height: 64px;
	}

	.content-tan input {
	width: 250px;
	padding-left: 20px;
	}

	.btn-tan{
	display: flex;
	justify-content: center;
	margin-top: 10px;
	}

	.btn-tan a {
	/*width: 151px;
	height: 46px;
	background-color: #fff;
	border: 1px solid #ff8a00;
	display: inline-block;
	text-align: center;
	line-height: 46px;
	color: #ff8a00;
	border-radius: 5px;*/


	width: 100%;
	height: 60px;
	background-color: #ff8a00;
	border: 1px solid #ff8a00;
	display: inline-block;
	text-align: center;
	line-height: 60px;
	color: #fff;
	}

	</style>
	<script type="text/javascript">
	//弹出隐藏层
	function ShowDiv(m) {
		$('#person').val($(m).attr("data-appid"));
		$('#telephone').val($(m).attr("data-appid1"));
		$('#MyDiv').show();
		$("#fade").height($(document).height());
		$('#fade').show();
	/* document.getElementById(show_div).style.display = 'block';
	document.getElementById(bg_div).style.display = 'block';
	var bgdiv = document.getElementById(bg_div);
	bgdiv.style.width = document.body.scrollWidth;
	// bgdiv.style.height = $(document).height();
	$("#" + bg_div).height($(document).height()); */
	};

	//关闭弹出层
	function CloseDiv(show_div, bg_div) {
	document.getElementById(show_div).style.display = 'none';
	document.getElementById(bg_div).style.display = 'none';
	};
	</script>
</body>

</html>